package com.yl.chainStore.services.warehouse

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.entity.pay.SysCompanyPayItemType
import com.yl.chainStore.entity.pay.SysCompanyPayItem
import com.yl.chainStore.entity.warehouse.*
import com.yl.chainStore.pojo.vo.pay.SystemCompanyPayItemSelectVo
import com.yl.chainStore.pojo.vo.warehouse.*
import com.yl.common.control.ResponseBody

/**
 * 仓库处理
 */
interface IWarehouseService {

	/**
	 * 获取物品类型列表
	 */
	fun getGoodTypeList(subCompanyId: Long): MutableList<SysCompanyPayItemType>

	/**
	 * 添加物品类型
	 */
	fun addGoodType(type: SysCompanyPayItemType): ResponseBody


	/**
	 * 获取物品列表
	 */
	fun getGoodPage(
		page: Page<SysCompanyPayItem>,
		vo: SystemCompanyPayItemSelectVo,
		deptId: Long
	): Page<SysCompanyPayItem>


	/**
	 * 添加一个收费项目(物品)
	 */
	fun addPayItem(item: SysCompanyPayItem, vo: UpdateItemConfigVo): ResponseBody


	/**
	 * 添加供应商
	 */
	fun addSupplier(supplier: WarehouseGoodSupplier): ResponseBody

	/**
	 * 供应商列表
	 */
	fun supplierList(vo: WarehouseGoodSupplierSelectVo): List<WarehouseGoodSupplier>


	/**
	 * 供应商列表分页
	 */
	fun supplierPage(page: Page<WarehouseGoodSupplier>, vo: WarehouseGoodSupplierSelectVo): Page<WarehouseGoodSupplier>

	/**
	 * 入库
	 */
	fun inWarehouse(goodBatchId: Long?, updateVo: UpdateWarehouseGoodVo): ResponseBody

	/**
	 * 出库(data 出库批次情况)
	 */
	fun outWarehouse(goodBatchId: Long?, updateLog: UpdateWarehouseGoodVo): ResponseBody

	/**
	 * 获取某个物品批次
	 */
	fun getGoodBatchCount(id: Long): WarehouseGoodBatchCount?

	/**
	 * 某个物品最后一次入库数量
	 */
	fun getLastBatchCount(companyId: Long, deptId: Long, itemId: Long): WarehouseGoodBatchCount?

	/**
	 * 物品总数
	 */
	fun getGoodsSumCount(companyId: Long, deptId: Long, itemId: Long): Int?

	/**
	 * 申请入库单(不添加明细)
	 */
	fun addInOrder(inOrder: WarehouseInOrder): ResponseBody

	/**
	 * 入库单分页查询
	 */
	fun inOrderPage(page: Page<WarehouseInOrder>, inOrder: WarehouseInOrderSelectVo): Page<WarehouseInOrder>

	/**
	 * 创建出库单
	 */
	fun addOutOrder(outOrder: WarehouseOutOrder): ResponseBody

	/**
	 * 出库分页查询
	 */
	fun outOrderPage(page: Page<WarehouseOutOrder>, outOrder: WarehouseOutOrderSelectVo): Page<WarehouseOutOrder>

	/**
	 * 创建调度单
	 */
	fun addDispatchOrder(dispatchOrder: WarehouseDispatchOrder): ResponseBody

	/**
	 * 调度单分页查询
	 */
	fun dispatchOrderPage(
		page: Page<WarehouseDispatchOrder>,
		dispatchOrder: WarehouseDispatchOrderSelectVo
	): Page<WarehouseDispatchOrder>

	/**
	 * 添加盘点单
	 */
	fun addCheckOrder(checkOrder: WarehouseCheckOrder): ResponseBody

	/**
	 * 盘点单分页查询
	 */
	fun checkOrderPage(
		page: Page<WarehouseCheckOrder>,
		checkOrder: WarehouseCheckOrderSelectVo
	): Page<WarehouseCheckOrder>

	/**
	 * 添加损益单
	 */
	fun addProfitLossOrder(order: WarehouseProfitLossOrder): ResponseBody

	/**
	 * 损益单分页
	 */
	fun profitLossPage(
		page: Page<WarehouseProfitLossOrder>,
		vo: WarehouseProfitLossOrderSelectVo
	): Page<WarehouseProfitLossOrder>
}
